package reflect;

import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMethod;

@AutoRunClass
public class Person {
    //    @AutoRunClass
    private String name;
    //    @AutoRunClass
    private int age;
    private String address;

    //@AutoRunClass
    public Person() {

    }

    public Person(//@AutoRunClass
                  String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    @AutoRunMethod(3)
    public void eat() {
        System.out.println("eat");
    }


    public void drink(String info, int count) {
        for (int i = 0; i <= count; i++) {
            System.out.println(name + "喝" + info);
        }
    }

    public void la(String info) {
        System.out.println(name + "拉" + info);
    }

    @AutoRunMethod(5)
    public void sleep() {
        System.out.println("sleep");
    }

    private void hh() {
        System.out.println("我是私有方法");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}
